package com.yiyefanchen.ai.service.impl;

import com.yiyefanchen.ai.service.DashScopeChatService;
import com.yiyefanchen.ai.service.ToolService;
import org.springframework.ai.tool.annotation.Tool;
import org.springframework.ai.tool.annotation.ToolParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ToolServiceImpl implements ToolService {

    @Autowired
    private DashScopeChatService dashScopeChatService;

    @Override
    @Tool(description = "删除会话ID，删除之前要先查询id是否存在，如果存在要让用户确认才可以删除！")
    public void deleteConversationId(@ToolParam(description = "会话ID") String conversationId) {
            dashScopeChatService.deleteByConversationId(conversationId);
    }

    @Override
    @Tool(description = "查询所有会话ID")
    public List<String> findConversationIds() {
        return dashScopeChatService.findConversationIds();
    }
}